<div class="container" data-ng-controller="NgModelController">
    <h3>Filtering Data using "filter"</h3>
    Name:<br />
    <input type="text" data-ng-model="inputData.name" placeholder="name" />
    <br />
    City:<br />
    <input type="text" data-ng-model="inputData.city" placeholder="city" />
    <br />
    <button class="btn btn-primary" data-ng-click="addCustomer()">Add Customer</button>
    <br />
    <br />

    <ul>
        <li data-ng-repeat="customer in customers">{{ customer.name }}</li>
    </ul>
</div>

<script>
    function NgModelController($scope) {
        $scope.customers = [
            { name: 'Dave Jones', city: 'Phoenix' },
            { name: 'Jamie Riley', city: 'Atlanta' },
            { name: 'Heedy Wahlin', city: 'Chandler' },
            { name: 'Thomas Winter', city: 'Seattle' }
        ];

        $scope.addCustomer = function () {
            $scope.customers.push({ name: $scope.inputData.name, city: $scope.inputData.city });
        };
    }

    samplesModule.controller('NgModelController', NgModelController);
</script>
